package xib.parserTools.interfaces;

import java.util.ArrayList;
import xib.utils.XibDataException;

/**
 * This interface defined all the functions needed to save properly all the
 * information about the Page from the source.
 * @author xavierds
 */
public interface IPageData {

    /**
     * Returns the height from this IPageData.
     * @return An integer with the height from this IPageData.
     * @throws XibDataException If the height has not been initialized properly.
     */
    public int getHeight();

    /**
     * Returns the width from this IPageData.
     * @return An integer with the width from this IPageData.
     * @throws XibDataException If the width has not been initialized properly.
     */
    public int getWidth();

    /**
     * Returns the position from this IPageData.
     * @return An integer with the position from this IPageData.
     * @throws XibDataException if the position of the page has not been
     * initialized properly.
     */
    public int getPosition();

    /**
     * Returns an ArrayList of IPanelData presents in this IPageData.
     * @return the list of PanelData from this IPageData.
     * @throws XibDataException If no panels weren't defined properly.
     */
    public ArrayList<IPanelData> getPanels();

    /**
     * Sets the width and height of this IPageData from the given values.
     * The width and height can not be less than 1.
     * @param width
     * @param height
     * @throws XibDataException If the width or height is less than 1.
     */
    public void setWidthAndHeight(int width, int height);

    /**
     * Sets the position of this IPageData from this given values.
     * The given position must be greater than 0.
     * @param position
     * @throws XibDataException If the given position is less than 1.
     */
    public void setPosition(int position);

    /**
     * Add a IPanelData to this IPageData. The given IPanelData can not be null or
     * already present in this IPageData.
     * @param pd 
     * @throws XibDataException If the given IPanelData is null or is already
     * defined.
     */
    public void addPanel(IPanelData pd);

    /**
     * Returns true if the data of the IPageData is initialized properly.
     * @return A boolean
     * @throws XibDataException If the height, width or some IPanelData aren't
     * defined properly.
     */
    public boolean validate();

}
